1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
| #include<stdio.h> #include<string.h> #include<ctype.h> unsigned int table[310]={969622712, 594890599, 1593930257, 1052452058, 890701766, 1677293387, 394424968, 266815521, 1532978959, 1211194088, 2019260265, 729421127, 953225874, 1117854514, 892543556, 2000911200, 514538256, 1400963072, 486675118, 1862498216, 1136668818, 758909582, 1653935295, 821063674, 888606944, 687085563, 890056597, 1513495898, 365692427, 184357836, 677395407, 863045227, 818746596, 391985767, 1842768403, 758385145, 1478392706, 1985112985, 1552765320, 746944881, 368385984, 1758203153, 1240817244, 660489060, 756944316, 1290697955, 844453952, 288239112, 1769473626, 1922176006, 826636519, 391520695, 1081548223, 1069693142, 1244729994, 766313326, 1101031894, 624951698, 14501479, 1794907983, 1460682958, 1660839647, 1104890686, 897721119, 1442187162, 480708164, 454443986, 1064446153, 1595150448, 1041527979, 1145775470, 1399869657, 255985995, 802693350, 2005610078, 1897360642, 2146073193, 1538606632, 431647857, 964049561, 395138253, 19164808, 856904574, 730737943, 708645054, 1506870658, 933323739, 819349658, 1780571206, 236747382, 533160167, 2042104933, 670325172, 2040165158, 1354372994, 705785180, 1669754395, 1066536508, 1426207888, 1437950089, 741941201, 796931522, 1694313338, 1290302874, 1367672048, 2039808424, 1062939821, 954597728, 1668694488, 859122242, 1369582617, 140269649, 53024683, 729221831, 816609203, 736893191, 55706320, 262747091, 1629838835, 581764799, 1488480625, 1607077349, 1879925846, 1453945819, 1521965565, 856558562, 1530662365, 1230847072, 1404918182, 1281256849, 1238970765, 272453753, 1640907491, 2127893021, 350314733, 556617458, 654390256, 1648581270, 531062411, 1862873022, 1241517385, 1471028336, 5121143, 1444839026, 1183580211, 1573659650, 2018540230, 1487873223, 234237236, 898254600, 1023090193, 728843548, 2007454357, 1451820833, 267351539, 302982385, 26807015, 865879122, 664886158, 195503981, 1625037691, 1330347906, 1742434311, 1330272217, 1645368040, 542321916, 1782121222, 411042851, 435386250, 1176704752, 1454246199, 1136813916, 1707755005, 224415730, 201138891, 989750331, 1006010278, 1147286905, 406860280, 840388503, 1282017578, 1605698145, 23396724, 862145265, 1898780916, 1855549801, 1571519230, 2083204840, 1859876276, 1602449334, 1009413590, 690816450, 86131931, 345661263, 1565025600, 857544170, 1329948960, 1211787679, 994381573, 991984748, 1956475134, 1098146294, 1655714289, 659576699, 689116467, 1485584392, 451884118, 255590636, 2108114754, 1266252396, 1589326471, 2019907768, 15552498, 1651075358, 614606175, 1656823678, 797605325, 1681594366, 2005080248, 624648446, 884695971, 1526931791, 1595240948, 439447199, 2060396292, 680093752, 409028215, 469068267, 195583689, 1791650630, 507724330, 1364025102, 1094582668, 813049577, 32316922, 1240756058, 1176200235, 2104494066, 325396055, 1796606917, 1709197385, 525495836, 1510101430, 735526761, 767523533, 1374043776, 1559389967, 567085571, 1560216161, 867042846, 1001796703, 1568754293, 628841972, 173812827, 379868455, 384973125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned int func(char *name, int flag, char a3, char a4) { unsigned int v5; unsigned __int8 v9,v10,v11,v12; unsigned int v13; unsigned int *v14; unsigned int *v16; unsigned int v15; int v17,v18,v19; int len,i; v5 = 0; len=strlen(name);
v9 = 0; v10 = 15 * a4; v11 = 0; v12 = 17 * a3; for(i=0;i<len;i++) { v13 = toupper(name[i]); v14 = &table[v12]; v15 = v5 + table[v13]; v16 = &table[v10]; v17 = table[(unsigned __int8)(v13 + 13)]; v18 = (unsigned __int8)(v13 + 47); v19 = v9; v12 += 9; v10 += 13; v9 += 19; v11 += 7;
v5 = *v16 + *v14 + table[v19] + table[v18] * (v15 ^ v17); } return v5; } int main() { int i; unsigned char key[10]; char v23=0x23; unsigned int v29=0x5002; unsigned int back,temp; char name[]="The_Itach1"; unsigned __int16 arr12; unsigned int arr089; back=func(name,1,char(v29),v23); temp=back; for(i=0;i<4;i++) { key[i+4]=temp&0xff; temp=temp>>8; }
key[3]=0xAC; arr12=(unsigned __int16) (((v23*0xB) ^ 0x3421)-19760)^ 0x7892;
key[2]=(arr12&0xff)^key[5]; key[1]=((arr12>>8)&0xff)^key[7];
arr089=((((v29*0x11)&0xffffff) ^ 0xFFE53167 )+ 180597) ^ 0x22C078 ^0x5B8C27; key[0]=arr089&0xff ^ key[6]; key[8]=(arr089>>8)&0xff ^ key[4]; key[9]=(arr089>>16)&0xff ^ key[5]; printf("name: %s\nkey: ",name); for(i=0;i<10;i++) { printf("%02x",key[i]); } }
|